//
// Created by Semir on 2020/6/8.
//

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

static bool cmp(const int& a, const int& b) {
    return a < b;
}

bool IsContinuous(vector<int> numbers) {
    if (numbers.size() < 5)
        return false;
    sort(numbers.begin(), numbers.end(), cmp);
    int i = 0;
    int cnt = 0;
    while (numbers[i] == 0) {
        cnt++;
        i++;
    }
    i++;
    while (i < numbers.size()) {
        if (i > 0 && numbers[i] == numbers[i - 1]) {
            return false;
        }
        if (i > 0 && numbers[i] - 1 != numbers[i - 1]) {
            cnt -= numbers[i] - 1 - numbers[i - 1];
            if (cnt < 0) {
                return false;
            }
        }
        i++;
    }
    return true;
}

int main() {
    vector<int> numbers = {0,0,2,4,6};
    cout << IsContinuous(numbers) << endl;
    return 0;
}